

*Brazil 2006 (study 55)

use "/Users/scottmorgenstern/Library/CloudStorage/OneDrive-UniversityofPittsburgh/_LA elite survey PELA (Salamanca)/_annual survey versions/2006/brazil 55 2006.dta"
*/

keep pais legis partido p62 p28 p2901 p2902 p2903 p2904 p2905 p2906 p2907 p2901 p2908 p2909 p2910 p35 /// 
p60 p60a p60b p61 p64 p65 p58 p59 p67 p62 p63


save  "/Users/scottmorgenstern/Library/CloudStorage/OneDrive-UniversityofPittsburgh/_LA elite survey PELA (Salamanca)/Pitt projects/_PELA 2022/consolidated surveys/Brazil2003to2007" , replace


gen wave=1
*this missing in original

label variable  pais "pais"
label variable pais "pais"
label variable partido "partido"
label variable p58 "your ideology left right 1-10"
label variable p59 "your party left right 1-10"
label variable p62 "p62 sexo"
label variable p28 "p28 Usted me podría decir si es más favorable a una economía regulada por el Est"
label variable p2901 "p2901 Controle dos preços"
label variable p2902 "p2902 Garantir uma educação fundamental e média ampla e gratuita"
label variable p2903 "p2903 Subsidiar a habitação"
label variable p2904 "p2904 Gerar empregos"
label variable p2905 "p2905 Garantir um sistema de aposentadoria e pensões"
label variable p2906 "p2906 Dar cobertura sanitária em geral"
label variable p2907 "p2907 Garantir uma educação universitária ampla e gratuita"
label variable p2908 "p2908 Dar cobertura de seguro-desemprego"
label variable p2909 "p2909 Proteger o meio ambiente"
label variable p2910 "p2910 Cobrir as necessidades básicas de todos os cidadãos"
label variable p35  "p35 ¿privatizações dos serviços públicos"
label variable p60  "p60 ¿Es adepto de alguna religión?"
label variable p60a "p60a  ¿Cuál es su religión?"
label variable p60b "p60b mínimo de religiosidade e prática religiosa"
label variable p61 "p61 presença de valores religiosos ou de princípios seculares"
label variable p64 "p64 divórcio"
label variable p65 "p65 aborto"

gen nestu=55
rename  pais country
gen date=2006
gen female=0
replace female=1 if p62==2


gen partylab=""
replace partylab="BR PT" if partido==1
replace partylab="BR PMDB" if partido==2
replace partylab="BR PFL" if partido==3
replace partylab="BR PP" if partido==4
replace partylab="BR PTB" if partido==5
replace partylab="BR PSDB" if partido==6
replace partylab="BR PL" if partido==7
replace partylab="BR PPS" if partido==8
replace partylab="BR PSB" if partido==9
replace partylab="BR PDT" if partido==10
replace partylab="BR PSC" if partido==11
replace partylab="BR PV" if partido==12
replace partylab="BR PSOL" if partido==13
replace partylab="BR PRONA" if partido==14
replace partylab="BR PCdoB" if partido==15


gen party=partylab
drop partido
gen partido=partylab



rename p62 sex


rename p28 reg_econ
rename p58 ID1
rename p59 ID2
rename p67 education
rename p63 age



rename p2901 control_prices
rename p2902 eco_education_p
rename p2903 eco_housing
rename p2904 eco_employment
rename p2905 eco_pensions
rename p2906 state_health_care
rename p2907 eco_education_u
rename p2908 eco_unemployment
rename p2909 eco_environment
rename p2910 eco_necessity
rename p35  eco_services
rename p60  religious
*note this is different than other countries; here Es ud adepto; other countries is "es ud creyente"

gen rel_catholic=0
replace rel_catholic=1 if p60a==1
* Valentina adds "if religious==1"

gen rel_evangelical=0
replace rel_evangelical=1 if p60a==2

gen rel_other=0
replace rel_other=1 if p60a>2 & p60a<9

rename p60a religion
rename p60b level_of_religiosity
rename p61 val_religious
rename p64 val_divorce
* 1-10, en contra =1 
rename p65 val_abortion



gen church_attend=level_of_religiosity
replace church_attend=. if  level_of_religiosity>10

gen regular_church=1 if level_of_religiosity>6  // mes o todos los domings
replace regular_church=0 if  level_of_religiosity<4  // casi nunca y varias al ano
replace regular_church=.5 if  level_of_religiosity>3 & level_of_religiosity<7  // moderates
* does this make sense to compare with others?
replace regular_church=. if level_of_religiosity>10  



/* 
val_abortion is 1-10 but reversed scale from what Valentina had! 
replace val_abortion =2 if p74==5
replace val_abortion =4 if p74==4
 replace val_abortion =6 if p74==3
replace val_abortion =8 if p74==2
replace val_abortion =10 if p74==1

*/
gen abort_rescale=.
replace abort_rescale=10 if val_abortion==1
replace abort_rescale=9 if val_abortion==2
replace abort_rescale=8 if val_abortion==3
replace abort_rescale=7 if val_abortion==4
replace abort_rescale=6 if val_abortion==5
replace abort_rescale=5 if val_abortion==6
replace abort_rescale=4 if val_abortion==7
replace abort_rescale=3 if val_abortion==8
replace abort_rescale=2 if val_abortion==9
replace abort_rescale=1 if val_abortion==10

replace val_abortion=abort_rescale


lab define val_abortion_reverse ///
	1 "Totally against" ///
	10 "Totally agree"
lab val val_abortion val_abortion_reverse


/* gen rel_catholic=1 if relig==1
replace rel_catholic=0 if rel_catholic~=1
* Valentina adds "if religious==1"


gen rel_evangelical=1 if relig==2
replace rel_evangelical=0 if  rel_evangelical~=1

*--------------------------
* Religious Other
*--------------------------
gen rel_other=1 if relig>2 & relig<9
replace rel_other=0 if rel_other<3 & rel_other>5

*/


lab var rel_catholic "Catholics (dummy 1 if catholic, 0 if religious but not catholic)"
lab var rel_other "Religious Other (dummy 1 if other, 0 if religious but not other)"
lab var val_abortion "Opinion about abortion (1-10 scale, 10 is most in favor)"




*/ 

save "/Users/scottmorgenstern/Library/CloudStorage/OneDrive-UniversityofPittsburgh/_LA elite survey PELA (Salamanca)/Pitt projects/_PELA 2022/consolidated surveys/Brazil2003to2007", replace
